//
// Created by Abstergo on 2024/6/14.
//

#ifndef TBS_CPP_POINTERITERATORINL_CUH
#define TBS_CPP_POINTERITERATORINL_CUH

template<typename T>
const void *PointerIterator<T>::source() const {
  return _ptr;
}

template<typename T>
const size_t PointerIterator<T>::index() const {
  return _index;
}

template<typename T>
Iterator<T> &PointerIterator<T>::next() {
  _index++;
  return *this;
}

template<typename T>
bool PointerIterator<T>::has_next() const {
  return _index + 1 <= _size;
}

template<typename T>
T &PointerIterator<T>::value() {
  return *(_ptr + _index);
}

template<typename T>
PointerIterator<T>::PointerIterator(T *ptr, const size_t &size, const size_t &index)
	:_ptr(ptr), _size(size), _index(index) {

}

#endif //TBS_CPP_POINTERITERATORINL_CUH
